import axios from "../utils/axios";

export const getMessageListApi = async (roomId: number) => {
  return await axios.get<IMessage[]>(`/message`, {
    params: { roomId },
  });
};

export const collectApi = (data: { messageId: number; type: number }) => {
  return axios.post("collect", data);
};

export const delCollectApi = (id: number) => {
  return axios.delete(`collect/${id}`);
};

export const getCollectOneApi = async (id: number) => {
  return await axios.get<ICollect[]>(`collect/${id}`);
};

export const getCollectListApi = async () => {
  return await axios.get<ICollect[]>("collect");
};
